package com.yj.cmp.sdk.fusioncompute.compute.vm.dto;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

@NoArgsConstructor
@Data
public class TvmDto {
    @SerializedName("name")
    private String name;
    @SerializedName("description")
    private String description;
    @SerializedName("group")
    private String group;
    @SerializedName("location")
    private String location;
    @SerializedName("isBindingHost")
    private boolean isBindingHost;
    @SerializedName("vmConfig")
    private VmConfigDTO vmConfig;
    @SerializedName("osOptions")
    private OsOptionsDTO osOptions;
    @SerializedName("isTemplate")
    private boolean isTemplate;
    @SerializedName("autoBoot")
    private boolean autoBoot;
    @SerializedName("isLinkClone")
    private boolean isLinkClone;
    @SerializedName("regionInfo")
    private String regionInfo;
    @SerializedName("vmCustomization")
    private VmCustomization vmCustomization;
    @SerializedName("publickey")
    private String publickey;
    @SerializedName("fileMode")
    private boolean fileMode;
    @SerializedName("drDrillOption")
    private Integer drDrillOption;
    @SerializedName("uuid")
    private String uuid;
    @SerializedName("isMultiDiskSpeedup")
    private boolean isMultiDiskSpeedup;
    @SerializedName("fileNames")
    private String[] fileNames;
    @SerializedName("vmDatas")
    private String[] vmDatas;
    @SerializedName("version")
    private Integer version;
    @SerializedName("clonedVmUUID")
    private String clonedVmUUID;
    @SerializedName("parentObjUrn")
    private String parentObjUrn;
    @SerializedName("floppyFile")
    private String floppyFile;
    @SerializedName("floppyProtocol")
    private String floppyProtocol;
    @SerializedName("customProperties")
    private Map<String, String> customProperties;
    @SerializedName("vncAccessInfo")
    private VncAccessInfoDTO vncAccessInfo;


    @NoArgsConstructor
    @Data
    public static class VncAccessInfoDTO {
        @SerializedName("hostIp")
        private String hostIp;
        @SerializedName("vncPort")
        private Integer vncPort;
        @SerializedName("vncPassword")
        private String vncPassword;
        @SerializedName("vncOldPassword")
        private String vncOldPassword;
    }

    @NoArgsConstructor
    @Data
    public static class OsOptionsDTO {
        @SerializedName("osType")
        private String osType;
        @SerializedName("osVersion")
        private Integer osVersion;
    }

    @NoArgsConstructor
    @Data
    public static class VmCustomization {
        @SerializedName("urn")
        private String urn;
        @SerializedName("uri")
        private String uri;
        @SerializedName("name")
        private String name;
        @SerializedName("description")
        private String description;
        @SerializedName("osType")
        private String osType;
        @SerializedName("hostname")
        private String hostname;
        @SerializedName("isUpdateVmPassword")
        private boolean isUpdateVmPassword;
        @SerializedName("password")
        private String password;
        @SerializedName("workgroup")
        private String workgroup;
        @SerializedName("domain")
        private String domain;
        @SerializedName("domainName")
        private String domainName;
        @SerializedName("domainPassword")
        private String domainPassword;
        @SerializedName("ouName")
        private String ouName;
        @SerializedName("isUpdateVmSid")
        private boolean isUpdateVmSid;

        @SerializedName("nicSpecification")
        private List<NicSpecificationDTO> nicSpecification;
        @SerializedName("runOnce")
        private List<RunOnceDTO> runOnce;

        @NoArgsConstructor
        @Data
        public static class NicSpecificationDTO {
            @SerializedName("ip")
            private String ip;
            @SerializedName("sequenceNum")
            private Integer sequenceNum;
            @SerializedName("netmask")
            private String netmask;
            @SerializedName("gateway")
            private String gateway;
            @SerializedName("setdns")
            private String setdns;
            @SerializedName("adddns")
            private String adddns;
            @SerializedName("ipVersion")
            private Integer ipVersion;
            @SerializedName("autoConfEnabled6")
            private boolean autoConfEnabled6;
            @SerializedName("dhcpEnabled6")
            private boolean dhcpEnabled6;
            @SerializedName("gatewayIpAddr6")
            private String gatewayIpAddr6;
            @SerializedName("setdns6")
            private String setdns6;
            @SerializedName("adddns6")
            private String adddns6;

            @SerializedName("route4Infos")
            private List<Route4Info> route4Infos;
            @SerializedName("route6Infos")
            private List<Route6Info> route6Infos;
            @SerializedName("ipAddress6")
            private List<IpAddress6> ipAddress6;


            @NoArgsConstructor
            @Data
            public static class Route4Info {
                @SerializedName("destination")
                private String destination;
                @SerializedName("genmask")
                private Integer genmask;
                @SerializedName("routeGateway")
                private String routeGateway;
            }

            @NoArgsConstructor
            @Data
            public static class Route6Info {
                @SerializedName("destination6")
                private String destination6;
                @SerializedName("genprefix")
                private Integer genprefix;
                @SerializedName("routeGateway6")
                private String routeGateway6;
            }

            @NoArgsConstructor
            @Data
            public static class IpAddress6 {
                @SerializedName("ipv6Addr")
                private String ipv6Addr;
                @SerializedName("ipv6Prefix")
                private String ipv6Prefix;
            }
        }

        @NoArgsConstructor
        @Data
        public static class RunOnceDTO {
            @SerializedName("command")
            private String command;
        }
    }

    @NoArgsConstructor
    @Data
    public static class VmConfigDTO {

        @SerializedName("cpu")
        private CpuDTO cpu;
        @SerializedName("disks")
        private List<DisksDTO> disks;
        @SerializedName("graphicsCard")
        private GraphicsCardDTO graphicsCard;
        @SerializedName("memory")
        private MemoryDTO memory;
        @SerializedName("nics")
        private List<NicsDTO> nics;
        @SerializedName("numaNodes")
        private Integer numaNodes;
        @SerializedName("pcis")
        private List<?> pcis;
        @SerializedName("properties")
        private PropertiesDTO properties;
        @SerializedName("usb")
        private List<UsbDTO> usb;
        @SerializedName("gpu")
        private List<GpuDTO> gpu;
        @SerializedName("gpuGroups")
        private List<GpuGroupDTO> gpuGroups;
        @SerializedName("cdromSequenceNum")
        private Integer cdromSequenceNum;


        @NoArgsConstructor
        @Data
        public static class GpuGroupDTO {
            @SerializedName("gpuGroup")
            private String gpuGroup;
            @SerializedName("count")
            private Integer count;
        }


        @NoArgsConstructor
        @Data
        public static class GpuDTO {
            @SerializedName("gpuUrn")
            private String gpuUrn;
            @SerializedName("isEffected")
            private boolean isEffected;
        }

        @NoArgsConstructor
        @Data
        public static class CpuDTO {
            @SerializedName("coresPerSocket")
            private Integer coresPerSocket;
            @SerializedName("cpuBindType")
            private String cpuBindType;
            @SerializedName("cpuHotPlug")
            private Integer cpuHotPlug;
            @SerializedName("cpuPolicy")
            private String cpuPolicy;
            @SerializedName("cpuThreadPolicy")
            private String cpuThreadPolicy;
            @SerializedName("limit")
            private Integer limit;
            @SerializedName("numaBinds")
            private List<VmDto.VmConfigDTO.CpuDTO.CpuNumaBind> numaBinds;
            @SerializedName("quantity")
            private Integer quantity;
            @SerializedName("reservation")
            private Integer reservation;
            @SerializedName("weight")
            private Integer weight;
            @SerializedName("exactCpuAffinityList")
            private List<VmDto.VmConfigDTO.CpuDTO.ExactCpuAffinity> exactCpuAffinityList;
            @SerializedName("affinitySet")
            private Integer[] affinitySet;

            @NoArgsConstructor
            @Data
            public static class ExactCpuAffinity {
                @SerializedName("vcpuScope")
                private Integer vcpuScope;
                @SerializedName("pcpuScope")
                private String pcpuScope;
            }

            @NoArgsConstructor
            @Data
            public static class CpuNumaBind {
                @SerializedName("nodeId")
                private Integer nodeId;
                @SerializedName("vcpus")
                private String vcpus;
            }
        }

        @NoArgsConstructor
        @Data
        public static class GraphicsCardDTO {
            @SerializedName("size")
            private Integer size;
            @SerializedName("type")
            private String type;
        }

        @NoArgsConstructor
        @Data
        public static class MemoryDTO {
            @SerializedName("hugePage")
            private String hugePage;
            @SerializedName("limit")
            private Integer limit;
            @SerializedName("memHotPlug")
            private Integer memHotPlug;
            @SerializedName("quantityMB")
            private Integer quantityMB;
            @SerializedName("reservation")
            private Integer reservation;
            @SerializedName("weight")
            private Integer weight;
            @SerializedName("unit")
            private String unit;
        }

        @NoArgsConstructor
        @Data
        public static class PropertiesDTO {
            @SerializedName("bootOption")
            private String bootOption;
            @SerializedName("vmFaultProcess")
            private String vmFaultProcess;
            @SerializedName("reoverByHost")
            private boolean reoverByHost;
            @SerializedName("clockMode")
            private String clockMode;
            @SerializedName("isEnableMemVol")
            private boolean isEnableMemVol;
            @SerializedName("isEnableFt")
            private boolean isEnableFt;
            @SerializedName("isEnableHa")
            private boolean isEnableHa;
            @SerializedName("isAutoUpgrade")
            private boolean autoUpgrade;
            @SerializedName("attachType")
            private boolean attachType;
            @SerializedName("gpuShareType")
            private String gpuShareType;
            @SerializedName("isReserveResource")
            private boolean isReserveResource;
            @SerializedName("secureVmType")
            private String secureVmType;
            @SerializedName("dpiVmType")
            private String dpiVmType;
            @SerializedName("isHpet")
            private boolean isHpet;
            @SerializedName("bootFirmware")
            private String bootFirmware;
            @SerializedName("bootFirmwareTime")
            private Integer bootFirmwareTime;
            @SerializedName("vmVncKeymapSetting")
            private Integer vmVncKeymapSetting;
            @SerializedName("cdRomBootOrder")
            private Integer cdRomBootOrder;
            @SerializedName("isAutoAdjustNuma")
            private boolean isAutoAdjustNuma;
            @SerializedName("numaAffinity")
            private Integer[] numaAffinity;
            @SerializedName("Realtime")
            private Integer[] Realtime;
            @SerializedName("emulatorPin")
            private Integer[] emulatorPin;
            @SerializedName("evsAffinity")
            private boolean evsAffinity;
        }

        @NoArgsConstructor
        @Data
        public static class DisksDTO {
            @SerializedName("pciType")
            private String pciType;
            @SerializedName("scsiCommandPassthrough")
            private boolean scsiCommandPassthrough;
            @SerializedName("sequenceNum")
            private Integer sequenceNum;
            @SerializedName("volumeUrn")
            private String volumeUrn;
            @SerializedName("volumeUrl")
            private String volumeUrl;
            @SerializedName("volumeUuid")
            private String volumeUuid;
            @SerializedName("quantityGB")
            private Integer quantityGB;
            @SerializedName("isDataCopy")
            private boolean isDataCopy;
            @SerializedName("datastoreUrn")
            private String datastoreUrn;
            @SerializedName("isThin")
            private boolean isThin;
            @SerializedName("indepDisk")
            private boolean indepDisk;
            @SerializedName("persistentDisk")
            private boolean persistentDisk;
            @SerializedName("storageType")
            private String storageType;
            @SerializedName("volType")
            private Integer volType;
            @SerializedName("maxReadBytes")
            private long maxReadBytes;
            @SerializedName("maxWriteBytes")
            private long maxWriteBytes;
            @SerializedName("maxReadRequest")
            private long maxReadRequest;
            @SerializedName("maxWriteRequest")
            private long maxWriteRequest;
            @SerializedName("type")
            private String type;
            @SerializedName("diskName")
            private String diskName;
            @SerializedName("ioWeight")
            private long ioWeight;
            @SerializedName("datastoreName")
            private String datastoreName;
            @SerializedName("isCoverData")
            private boolean isCoverData;
            @SerializedName("bootOrder")
            private Integer bootOrder;
            @SerializedName("device_type")
            private String device_type;
            @SerializedName("ioMode")
            private String ioMode;
            @SerializedName("accessMode")
            private Integer accessMode;
            @SerializedName("systemVolume")
            private boolean systemVolume;
            @SerializedName("devName")
            private String devName;
            @SerializedName("volNameOnDev")
            private String volNameOnDev;
            @SerializedName("drExtParams")
            private String drExtParams;
            @SerializedName("volumeAttachStatus")
            private String volumeAttachStatus;
        }

        @NoArgsConstructor
        @Data
        public static class NicsDTO {

            @SerializedName("bootOrder")
            private Integer bootOrder;
            @SerializedName("enableSecurityGroup")
            private Boolean enableSecurityGroup;
            @SerializedName("ip")
            private String ip;
            @SerializedName("ipList")
            private String ipList;
            @SerializedName("ipv6s")
            private String ipv6s;
            @SerializedName("mac")
            private String mac;
            @SerializedName("name")
            private String name;
            @SerializedName("nicConfig")
            private NicConfigDTO nicConfig;
            @SerializedName("nicType")
            private Integer nicType;
            @SerializedName("portGroupName")
            private String portGroupName;
            @SerializedName("portGroupUrn")
            private String portGroupUrn;
            @SerializedName("portId")
            private String portId;
            @SerializedName("sequenceNum")
            private Integer sequenceNum;
            @SerializedName("uri")
            private String uri;
            @SerializedName("urn")
            private String urn;
            @SerializedName("virtIo")
            private Integer virtIo;
            @SerializedName("securityGroupId")
            private long securityGroupId;

            @NoArgsConstructor
            @Data
            public static class NicConfigDTO {
                @SerializedName("vringbuf")
                private Integer vringbuf;
                @SerializedName("queues")
                private Integer queues;
            }
        }

        @NoArgsConstructor
        @Data
        public static class UsbDTO {
            @SerializedName("controllerType")
            private String controllerType;
            @SerializedName("device")
            private List<VmDto.VmConfigDTO.UsbDTO.DeviceDto> device;

            @NoArgsConstructor
            @Data
            public static class DeviceDto {
                @SerializedName("usbUrn")
                private String usbUrn;
                @SerializedName("usbHostName")
                private String usbHostName;
            }
        }
    }

    @NoArgsConstructor
    @Data
    public static class Mode {
        @SerializedName("mode")
        private String mode;
    }
}
